package com.example.wm.controller;

import com.example.wm.common.Result;
import com.example.wm.common.ResultData;
import com.example.wm.entity.Trailer;
import com.example.wm.mapper.TrailerMapper;
import com.example.wm.service.TrailerService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@Slf4j
@RestController
@RequestMapping("/Trailer")
@CrossOrigin
public class TrailerController {

    public class PrejudgmentController {
        @Resource
        private TrailerService trailerService;
        @Resource
        private TrailerMapper trailerMapper;

        @Transactional
        @PostMapping("/addnewtg")
        public Result addnewtg(@RequestBody Trailer yugao) {
         Boolean a=  trailerService.save(yugao);
            return ResultData.success(a);
        }
    }
}